package com.gqr.syc;

/*
*  同一把锁 不需要再次取锁 直接调用
* */
public class SynchronizedOtherMethod11 {
    int a = 0;

    public synchronized void method1(){
        System.out.println("这是method1");
        method2();


    }

    public synchronized void method2(){
        System.out.println("这是method2");

    }
    public static void main(String[] args) {
        SynchronizedOtherMethod11 s = new SynchronizedOtherMethod11();
        s.method1();
    }
}
